package com.cch.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author cch
 * @date 2025年05月21日 11:10
 */
@Controller
@RequestMapping(("/html"))
public class HtmlController {

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/login3")
    public String login3() {
        return "login3";
    }

    @RequestMapping("/main")
    public String main() {
        return "main";
    }

    @RequestMapping("/main2")
    public String main2() {
        return "main2";
    }

    @RequestMapping("/error")
    public String error(HttpServletRequest request) {
        System.out.println("error:" + request.getAttribute("SPRING_SECURITY_LAST_EXCEPTION"));
        return "error";
    }

}
